-- GENERATED SPELL FOR [Crystalline Tender] --


function spell0_28231(pUnit, Event) --@Toughen Hide,Self--
pUnit:FullCastSpellOnTarget(50994,pUnit)
pUnit:RegisterEvent('Sorts_28231', 15282, 1)
end

function spell1_28231(pUnit, Event) --@Tranquility,Self--
pUnit:FullCastSpellOnTarget(51972,pUnit)
pUnit:RegisterEvent('Sorts_28231', 10000, 1)
end

function spell2_28231(pUnit, Event) --@Tranquility,Self--
pUnit:FullCastSpellOnTarget(57054,pUnit)
pUnit:RegisterEvent('Sorts_28231', 10000, 1)
end

function Sorts_28231(pUnit, Event)
local choix_sorts_28231 = math.random(0, 2)
if choix_sorts_28231 == 0 then
pUnit:RegisterEvent('spell0_28231', 1, 1)
end
if choix_sorts_28231 == 1 then
pUnit:RegisterEvent('spell1_28231', 1, 1)
end
if choix_sorts_28231 == 2 then
pUnit:RegisterEvent('spell2_28231', 1, 1)
end
end

function mob28231_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_28231', math.random(1500, 3000), 1)
end

function mob28231_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob28231_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob28231_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(28231, 1, 'mob28231_Action')
RegisterUnitEvent(28231, 2, 'mob28231_Leave')
RegisterUnitEvent(28231, 3, 'mob28231_Kill')
RegisterUnitEvent(28231, 4, 'mob28231_Die')
